package com.chexiehui.jc.ui.activity;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.View;

import com.chexiehui.jc.R;
import com.chexiehui.jc.base.BaseActivity;
import com.chexiehui.jc.ui.fragment.MyFollowSeriesFragment;
import com.chexiehui.jc.ui.fragment.MyFollowUserFragment;
import com.flyco.tablayout.SlidingTabLayout;

import java.util.ArrayList;

import butterknife.BindView;

/**
 * 我的关注
 */
public class MyFollowActivity extends BaseActivity {

    @BindView(R.id.vp_type_pager)
    ViewPager vpTypePager;
    private SlidingTabLayout stl_car_garage_tab;
    private String[] titles = new String[]{"用户", "车系"};
    private ArrayList<Fragment> forumFragmentList = new ArrayList<>();

    @Override
    protected void setTitleBar() {
        View centerAction = View.inflate(mContext, R.layout.layout_title_action_my_follow, null);
        stl_car_garage_tab = centerAction.findViewById(R.id.stl_type_tab);
        titleBar.addCenterAction(titleBar.new ViewAction(centerAction));
    }

    @Override
    protected int getLayout() {
        return R.layout.activity_my_follow;
    }

    @Override
    protected void initView(Bundle var1) {
        forumFragmentList = new ArrayList<>();
        vpTypePager.setOffscreenPageLimit(titles.length);
        forumFragmentList.add(MyFollowUserFragment.getInstance());
        forumFragmentList.add(MyFollowSeriesFragment.getInstance());
        stl_car_garage_tab.setViewPager(vpTypePager, titles, this, forumFragmentList);
    }
}
